package mylibrary.jndi.self;

import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;

public class MyInitialContextFactory implements InitialContextFactory {

	private static MyContext context;
	
	public Context getInitialContext(Hashtable<?, ?> environment)
			throws NamingException {
		
		System.out.println("In factory: environment = "  + environment);

		if(context == null) {
			context = new MyContext();	
		}
		return context;
	}


}
